package com.livegoods.commons.pojo;

import lombok.Data;

@Data
public class LivegoodsResult{
    private int status; //状态码 200成功 500 失败
    private String msg; //成功或者失败的消息
    private Object data; //数据
    private Object results; //返回结果

    private boolean hasMore;//分页是否到还有数据 true 继续分页， fasle 到尾页了，前端看到false用户翻页给提示：我是有底线的...


    private long time;//获取预定时间

    private Integer totalPage;

    public static LivegoodsResult ok(){
        LivegoodsResult result = new LivegoodsResult();
        result.setStatus(200);
        result.setMsg("ok");
        return result;
    }

    public static LivegoodsResult ok(Object data){
        LivegoodsResult result = new LivegoodsResult();
        result.setStatus(200);
        result.setMsg("ok");
        result.setData(data);
        return result;
    }

    public static LivegoodsResult error(String msg){
        LivegoodsResult result = new LivegoodsResult();
        result.setStatus(500);
        result.setMsg(msg);
        return result;
    }
}
